import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [

   {
    title: '项目名称',
     align:"left",
    dataIndex: 'projectId_dictText',
     width: 400
   },
  {
    title: '项目序号',
    align:"left",
    dataIndex: 'sortNo'
  },
  {
    title: '付款名称',
    align:"center",
    dataIndex: 'name'
  },
   {
    title: '费用申请状态',
    align:"center",
    dataIndex: 'status_dictText'
   },

   {
    title: '付款类型',
    align:"center",
    dataIndex: 'payType_dictText'
   },
  {
    title: '百分比',
    align:"center",
    dataIndex: 'percent'
  },
  //  {
  //   title: '付款对象',
  //   align:"center",
  //   dataIndex: 'payObject'
  //  },
  {
    title: '付款金额',
    align:"center",
    dataIndex: 'amount'
  },
   {
    title: '税点',
    align:"center",
    dataIndex: 'fax'
   },
   {
    title: '收款行',
    align:"center",
    dataIndex: 'receiveBank'
   },
   {
    title: '收款账户',
    align:"center",
    dataIndex: 'receiveAccount'
   },
   {
    title: '收款名称',
    align:"center",
    dataIndex: 'receiveName'
   },
  //  {
  //   title: '商品清单',
  //   align:"center",
  //   dataIndex: 'goodsBill'
  //  },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '发票号',
    align:"center",
    dataIndex: 'invoiceNo'
   },
];
export const logColumns = [
  {
    title: '时间',
    dataIndex: 'applyTime',
    key: 'applyTime',
  },
  {
    title: '结果',
    dataIndex: 'applyStatus',
    key: 'applyStatus',
  },
  {
    title: '审核意见',
    dataIndex: 'applyContent',
    key: 'applyContent',
  },
  {
    title: '审核人',
    dataIndex: 'applyUserName',
    key: 'applyUserName',
  }
]

export const userColumn = [
  {
    title: '姓名',
    dataIndex: 'name',
},
{
    title: '成本',
    dataIndex: 'salaryMoney',
},
{
    title: '开始时间',
    dataIndex: 'socialSecurity',
},
{
    title: '结束时间',
    dataIndex: 'accumulationFund',
},
{
    title: '工作量',
    dataIndex: 'accumulationFund',
},
{
    title: '工作内容',
    dataIndex: 'accumulationFund',
},
{
    title: '工作量描述',
    dataIndex: 'accumulationFund',
}
]

export const budgeColumn = [
  {
    title: '过往结余(可抵扣)',
    dataIndex: 'historyRemainder',
    key: 'historyRemainder',
  },
  {
      title: '当月已用',
      dataIndex: 'currentMonthConsume',
      key: 'currentMonthConsume',
  },
  {
      title: '当月剩余',
      dataIndex: 'remainderBudget',
      key: 'remainderBudget',
  },
  {
      title: '当前付款',
      dataIndex: 'payAmount',
      key: 'payAmount',
  },
  {
      title: '当前预算状态',
      dataIndex: 'costStatus',
      key: 'costStatus',
  }
]

export const budgeColumnOt = [
    {
        title: '年度成本总额',
        dataIndex: 'totalCost',
        key: 'totalCost',
    },{
        title: '累计已用',
        dataIndex: 'totalAmount',
        key: 'totalAmount ',
    },
    {
        title: '累计剩余',
        dataIndex: 'remainderBudget',
        key: 'remainderBudget',
    },
    {
        title: '当前付款',
        dataIndex: 'payAmount',
        key: 'payAmount',
    },
    {
        title: '当前预算状态',
        dataIndex: 'costStatus',
        key: 'costStatus',
    },
]

export const budgeDsfColumn = [
  {
      title: '年度第三方总额',
      dataIndex: 'totalCost',
      key: 'totalCost',
  },
  {
      title: '已使用额度',
      dataIndex: 'totalAmount',
      key: 'totalAmount',
  },
  {
      title: '已使用百分比',
      dataIndex: 'costPercent',
      key: 'costPercent',
  },
  {
      title: '当前剩余',
      dataIndex: 'remainderBudget',
      key: 'remainderBudget',
  },
  {
      title: '当前状态',
      dataIndex: 'costStatus',
      key: 'costStatus',
  },
]

export const budgeHrColumn = [
  {
      title: '人力成本总额',
      dataIndex: 'totalCost',
      key: 'totalCost',
  },
  {
      title: '已使用总额',
      dataIndex: 'totalAmount',
      key: 'totalAmount',
  },
  {
      title: '剩余总额',
      dataIndex: 'remainderBudget',
      key: 'remainderBudget',
  },
  {
      title: '剩余可支配月费',
      dataIndex: 'currentMonthConsume',
      key: 'currentMonthConsume',
  },
  // {
  //     title: '当前预算状态',
  //     dataIndex: 'costStatus',
  //     key: 'costStatus',
  // },
]

export const xzColumns = [
  {
    title: '项目名称',
    dataIndex: 'projectName',
    key: 'projectName',
  },
  {
      title: '状态',
      dataIndex: 'applyStatus',
      key: 'applyStatus',
      slot: 'applyStatus'
  },
  {
      title: '审核内容',
      dataIndex: 'applyContent',
      key: 'applyContent',
  },
  {
      title: '审核时间',
      dataIndex: 'applyTime',
      key: 'applyTime',
  },
  {
      title: '审核人',
      dataIndex: 'applyUserName',
      key: 'applyUserName',
  },
]

export const officeColumns = [
  {
    title: '差旅总额',
    dataIndex: 'totalCost',
    key: 'totalCost',
},
{
    title: '已使用额度',
    dataIndex: 'totalAmount',
    key: 'totalAmount',
},
{
    title: '已使用百分比',
    dataIndex: 'costPercent',
    key: 'costPercent',
},
{
    title: '当前剩余',
    dataIndex: 'remainderBudget',
    key: 'remainderBudget',
},
]

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '项目名称',
    field: 'projectName',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    label: '项目序号',
    field: 'sortNo',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    field: 'customId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_custom,name,id'
    },
    label: '所属客户',
    colProps: { span: 4 },
  },
  {
    label: '付款名称',
    field: 'name',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    label: '收款名称',
    field: 'receiveName',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    label: '费用申请状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'submitStatus',
      stringToNumber: true,
    },
    colProps: { span: 5 },
  },
  {
    label: '付款类型',
    field: 'payType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'payType',
      stringToNumber: true,
    },
    colProps: { span: 4 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id,setup_status=3 and project_status=1'
    },
    label: '项目',
    // dynamicRules: ({ values }) => rules.confirmPassword(values, true),
  },
  {
    label: '付款类型',
    field: 'payType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'payType',
      stringToNumber: true,
    },
    required: true,
  },
  {
    label: '',//是否有记录
    field: 'jl',
    component: 'JDictSelectTag',
    slot: 'typeDom',
  },
  {
    label: '付款名称',
    field: 'name',
    component: 'Input',
    slot: 'nameDom'
  },
  {
    label: '百分比',
    field: 'percent',
    component: 'Input',
    slot: 'InputDom',
    componentProps: {
      suffix: '%',
      maxlength: 3
    },
  },
  // {
  //   label: '付款对象',
  //   field: 'payObject',
  //   component: 'Input',
  //   required: true,
  // },
  {
    label: '付款金额',
    field: 'amount',
    component: 'Input',
    required: true,
    componentProps: {
      // suffix: '元'
    },
  },
  {
    label: '税点',
    field: 'fax',
    component: 'Input',
    componentProps: {
      suffix: '%',
      maxlength: 3
    },
  },
  {
    label: '收款名称',
    field: 'receiveName',
    component: 'Input',
    required: true,
  },
  {
    label: '收款行',
    field: 'receiveBank',
    component: 'Input',
    required: true,
  },
  {
    label: '收款账户',
    field: 'receiveAccount',
    component: 'Input',
    required: true,
  },

  // {
  //   label: '商品清单',
  //   field: 'goodsBill',
  //   component: 'Input',
  // },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '发票号',
    field: 'invoiceNo',
    component: 'Input',
  },

  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

//表单数据
export const dsfFormSchema: FormSchema[] = [
  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id,setup_status=3 and project_status=1'
    },
    label: '项目',
    required: true,
  },

/*  {
    label: '费用申请状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'submitStatus',
      stringToNumber: true,
    },
  },*/

  // {
  //   label: '第三方类型',
  //   field: 'type',
  //   component: 'JDictSelectTag',
  //   componentProps: {
  //     dictCode: 'serviceType',
  //     stringToNumber: true,
  //   },
  // },
  {
    label: '付款类型',
    field: 'payType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'payType',
      stringToNumber: true,
    },
  },
  {
    label: '付款名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '百分比',
    field: 'percent',
    component: 'Input',
  },
  {
    label: '付款金额',
    field: 'amount',
    component: 'Input',
    required: true,
  },
  {
    label: '税点',
    field: 'fax',
    component: 'Input',
    componentProps: {
      suffix: '%',
      maxlength: 3
    },
  },
  {
    label: '收款名称',
    field: 'receiveName',
    component: 'Input',
  },
  {
    label: '收款行',
    field: 'receiveBank',
    component: 'Input',
  },
  {
    label: '收款账户',
    field: 'receiveAccount',
    component: 'Input',
  },

  // {
  //   label: '商品清单',
  //   field: 'goodsBill',
  //   component: 'Input',
  // },
  {
    label: '发票号',
    field: 'invoiceNo',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
    border: 'left',
  },
  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    border: 'left',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
